package com.bnzj.core.config;

import com.bnzj.core.web.security.CustomAccessDeniedHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName SecurityServletConfiguration
 * @Description TODO
 * @Author
 * @Date 2020/3/10
 * @Version V1.0
 **/
@Configuration
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
public class SecurityServletConfiguration {

    @Bean
    @ConditionalOnMissingBean(name = "customAccessDeniedHandler")
    public CustomAccessDeniedHandler customAccessDeniedHandler(){
        return new CustomAccessDeniedHandler();
    }
}
